home *** CD-ROM | disk | FTP | other *** search
- //@doc STRAT HDR CORE
- //@module STRAT.H - Strategy declarations |
- //
- // This file contains the declaration of the strategy class.
- //
- //@normal Copyright <cp> 1996 Meta Four Software. All rights reserved.
-
- #ifndef __K4STRAT_H__
- #define __K4STRAT_H__
-
- /////////////////////////////////////////////////////////////////////////////
- // Declarations in this file
-
- class c4_Strategy; // system and file interface
-
- /////////////////////////////////////////////////////////////////////////////
- //@class A strategy encapsulates code dealing with file I/O and the system.
-
- class c4_Strategy
- {
- public: //@access Public members
- //@cmember Constructs a new strategy object.
- c4_Strategy ();
- //@cmember Destructor.
- virtual ~c4_Strategy ();
-
- //@cmember Open a data file by name.
- virtual bool DataOpen(const char*, bool);
-
- //@cmember Set file position.
- virtual void DataSeek(long);
- //@cmember Read a number of bytes.
- virtual int DataRead(void*, int);
- //@cmember Read an exact number of bytes.
- virtual void DataLoad(void*, int);
- //@cmember Write a number of bytes.
- virtual void DataWrite(const void*, int);
- //@cmember Flush and truncate file.
- virtual void DataCommit(long);
-
- //@cmember Consume some bytes sequentially.
- virtual int StreamRead(void*, void*, int);
- //@cmember Produce some bytes sequentially.
- virtual void StreamWrite(void*, const void*, int);
-
- protected: //@access Protected members
- //@cmember Pointer to file object.
- c4_File* _file;
-
- friend class c4_Storage;
- };
-
- /////////////////////////////////////////////////////////////////////////////
-
- #endif
-
- // $Id: k4strat.h,v 1.7 1996/12/08 11:22:32 jcw Exp $
-